<?php
include("C_TSYZ.php");
$mc = memcache_init();
$SD = new C_TSYZ();
$postObj=$SD->ReceiveMsg();
$MsgType=$SD->GetMsgType($postObj);

if($MsgType=="event")
{
    $SD->Subscribe($postObj);
}

if($MsgType=='image')
{
    $SD->uploadimg($postObj);
}
  
if($MsgType=='text')
{       $form_Content = trim($postObj->Content);
        if ($form_Content == "菜单") //菜单
           $SD->Menu ($postObj);
        if($form_Content == "刷"||($mc->get($postObj->FromUserName . "_do") == "刷"&&strtolower($form_Content)=="n"))//发布文字微博
           $SD->weibolist($postObj);
        if(($form_Content == "发图"||$mc->get($postObj->FromUserName . "_do") == "发图"))//发布文字微博
           $SD->ImgWeibo ($postObj);
        if(($form_Content == "发布"||$mc->get($postObj->FromUserName . "_do") == "发布"))//发布文字微博
           $SD->TextWeibo ($postObj);  
        if(($form_Content == "留言"||$mc->get($postObj->FromUserName . "_do") == "留言"))//留言
           $SD->mail ($postObj);
        if((($form_Content =="外卖"||$mc->get($postObj->FromUserName . "_do") == "外卖")))//外卖菜单
		   $SD->takeawaymenu($postObj);
        if((($form_Content =="鸡鸡"||$mc->get($postObj->FromUserName . "_do") == "鸡鸡")))//simsimi机器人
           $SD->simsimi ($postObj);
        if($form_Content == "天气")//天气
           $SD->weather ($postObj);       
        if ($form_Content == "关于")
           $SD->about($postObj);
      
	else
           $SD->error($postObj);   
}
?>
